<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ include file="../common.jsp" %>
<%@ taglib uri="/struts-tags" prefix="s" %>
<%@ taglib uri="/WEB-INF/tld/fmt.tld" prefix="fmt" %>
<form id="policy_form" action="#" method="post">
<table border="0" cellpadding="0" cellspacing="0" style="width:800px" class="mytable">
	<tr><th class="left">政策返点</th><th>上下班时间</th><th>出票速度</th><th>出票手续费</th><th>备注</th></tr>
	<s:iterator value="#request.policies" var="policy">
		<tr>
		<td class="left" style="text-align: center;">
			<input type="radio" name="policyId" id="policy_${policy.policyId}" policy-data="${policy.discounts}" policy-desc="${policy.remark}" value="${policy.rateId}" ${childOrder.policyId eq policy.rateId?'checked':''} />
		<label for="policy_${policy.policyId}" style="font-weight: bold; color: red"><fmt:formatNumber value="${policy.discounts}" pattern="#" />%</label></td>
		<td style="text-align: center;">${policy.workTimeBegin}-${policy.workTimeEnd}</td>
		<td style="text-align: center;">${policy.sp}</td>
		<td style="text-align: center;">￥${policy.xf}</td>
		<td>${policy.remark!=null&&policy.remark!=''?policy.remark:'暂无'}</td>
		</tr>
	</s:iterator>
</table></form>

<script type="text/dialog">
var api=this,
form=$('#policy_form');
api.title('政策信息').button(
	{	
		name:'确定',
		focus:true,
		callback:function(){
			// 提交数据信息
			var rateId=$('input[name="policyId"]:checked').val();
			var dis = $('input[name="policyId"]:checked').attr('policy-data');
			var desc = $('input[name="policyId"]:checked').attr('policy-desc');
			$.ajax({
				url:'./plane/policy_updateChildPolicy.shtml',
				cache:false,
				type:'POST',
				data:{rateId:rateId,dis:dis,cid:${childOrder.id},policy_desc:desc},
				success:function(data){//提交成功
					location.reload();		
				}
			});
			return false;
		}
	},
	{
		name:'取消'
	}

);
</script>